# Maintainer: David Runge <dave@sleepmap.de>
pkgname=zita-dpl1
pkgver=0.3.3
pkgrel=3
pkgdesc="A look-ahead digital peak level limiter"
arch=('loong64' 'x86_64')
url="https://kokkinizita.linuxaudio.org/linuxaudio/"
license=('GPL3')
groups=('pro-audio')
depends=('cairo' 'clthreads' 'clxclient' 'jack')
makedepends=('gendesk')
source=("https://kokkinizita.linuxaudio.org/linuxaudio/downloads/${pkgname}-${pkgver}.tar.bz2")
sha512sums=('f1c5d3fb61feadb9c272d137669a5893fd949a9d75e76633baa0bcbc9755cb1ac0fb1faacffce03e747d383ddcf36f8c22ec83dea558c0fa674d6a898bb7e35c')

prepare() {
  cd "${pkgname}-${pkgver}"
  # strip -march=native
  sed -e '/native/d' \
      -e 's/freetype-config\ --cflags/pkgconf\ --cflags\ freetype2/' \
      -i source/Makefile
  gendesk -n \
          --pkgname ${pkgname} \
          --pkgdesc "${pkgdesc}" \
          --name zita-dpl1 \
          --categories "AudioVideo;Audio"
}

build() {
  cd "${pkgname}-${pkgver}/source"
  make PREFIX=/usr
}

package() {
  cd "${pkgname}-${pkgver}/source"
  make PREFIX=/usr DESTDIR="$pkgdir/" install
  # XDG desktop integration
  install -vDm 644 "../${pkgname}.desktop" \
    -t "${pkgdir}/usr/share/applications/"
  # docs
  install -t "${pkgdir}/usr/share/doc/${pkgname}" \
    -vDm 644 ../doc/* \
    -vDm 644 ../{AUTHORS,README}
}
# vim:set ts=2 sw=2 et:
